import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../components/Home.vue'
import Search from '../components/search/Search.vue'
import Find from '../components/findmusic/Find.vue'
import Songsheetdetail from '../components/songsheet/Songsheetdetail'
import Ranking from '../components/rank/Ranking'
import Songsheet from '../components/songsheet/Songsheet'
import Videodetail from '../components/video/Videodetail'
import Video from '../components/video/Video'
import Singer from '../components/singer/Singer'
import SingerDetail from '../components/singer/Singerdetail'
// 测试页面，用来验证一些方法
import Test from '../components/test/test'

Vue.use(VueRouter)

const routes = [
  { path: '/', redirect: '/findmusic' },
  {
    path: '/home',
    component: Home,
    children: [
      // 搜索
      { path: '/search', component: Search },
      //   发现音乐
      {
        path: '/findmusic',
        component: Find
      },
      //   排行榜
      { path: '/ranking', component: Ranking },
      //   歌单
      { path: '/songsheet', component: Songsheet },
      { path: '/songsheet/songsheetdetail/:id', component: Songsheetdetail },
      //   mv
      {
        path: '/video',
        component: Video
        // redirect: '/video/videodetail'

      },
      //   mv详情
      { path: '/video/videodetail/:id', component: Videodetail },
      //   歌手
      { path: '/singer', component: Singer },
      { path: '/singer/singerdetail/:id', component: SingerDetail },
      //   我的音乐
      { path: '/mymusic' },
      { path: '/test', component: Test }

    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
